#include "teachptitem.h"
#include <QPainter>
#include "toolkit.h"
#include "game/teachgamescene.h"
#include "man/manitem.h"

TeachPtItem::TeachPtItem()
{
}

void TeachPtItem::render()
{
    m_pixmap->fill(0);
    QPainter p(m_pixmap);
    if(ToolKit::m_teachGameScene != NULL)
    {
        ManItem* item = ToolKit::m_teachGameScene->m_catchItem;
        if(item != NULL && !item->m_linelist.isEmpty() && item->isVisible())
        {
            switch(item->m_lineTp)
            {
            case Hatch_LTP:
            {
                foreach(QPointF pt,item->m_linelist)
                {
                    p.drawImage(QRectF(pt,QSize(14,14)),m_ptimage,
                                QRectF(14.0,0.0,14.0,14.0));
                }
            }
            break;
            default:
                break;
            }
        }
    }
}
